home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes reversed ƒ / Four corner wipe reversed.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.6 KB  |  53 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  5. #define theWindowWidth (boundsRect.right-boundsRect.left)
  6.  
  7. pascal short FourCornerReversed(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Take four rects, one at each corner, and make them bigger, growing on each
  10.    side of the screen.  This means lots of overlap copying, but the timing masks
  11.    it and Quickdraw may even take care of some of it. (?) */
  12.  
  13. pascal short FourCornerReversed(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  14. {
  15.     Rect        tl,tr,bl,br;
  16.     short            cx,cy;
  17.     short            VBarGap, HBarGap;
  18.     
  19.     VBarGap=theWindowWidth/100;
  20.     HBarGap=theWindowHeight/100;
  21.  
  22.     cx = boundsRect.left + theWindowWidth/2;
  23.     cy = boundsRect.top + theWindowHeight/2;
  24.     
  25.     tl.top=tr.top=tl.bottom=tr.bottom=boundsRect.top;
  26.     tl.left=bl.left=tl.right=bl.right=boundsRect.left;
  27.     tr.right=br.right=tr.left=br.left=boundsRect.right;
  28.     bl.bottom=br.bottom=bl.top=br.top=boundsRect.bottom;
  29.     while (tl.right<cx)
  30.     {
  31.         StartTiming();
  32.         tl.bottom+=HBarGap;
  33.         tr.bottom+=HBarGap;
  34.         bl.top-=HBarGap;
  35.         br.top-=HBarGap;
  36.         tl.right+=VBarGap;
  37.         bl.right+=VBarGap;
  38.         tr.left-=VBarGap;
  39.         br.left-=VBarGap;
  40.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  41.             &tl, &tl, 0, 0L);
  42.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  43.             &tr, &tr, 0, 0L);
  44.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  45.             &bl, &bl, 0, 0L);
  46.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  47.             &br, &br, 0, 0L);
  48.         TimeCorrection(CorrectTime);
  49.     }
  50.     
  51.     return 0;
  52. }
  53.